import { createApp } from 'vue'
// 
import App from './App.vue'
import router from './router/index.js'
import axios from "axios"
import { createStore } from 'vuex'

import store from './store/index.js'
import {$get,$postx,$postj,$postf} from './ajax/index.js'

import ElementPlus from "element-plus"
import 'element-plus/dist/index.css'
// const app = createApp(App)
// app.use(store)
// app.use(router)
// app.config.globalProperties.$axios = axios
// const vm = app.mount('#app')

//创建一个实例

// const store = createStore({
// 	state() {
// 		return{
// 			user:{
// 				uname:null,
// 				role:null,
// 				pic:null,
// 				token:null
// 			}
// 		}
// 	}
// })

var vm = createApp(App)
vm.use(router)
vm.use(store)

// const app = createApp(App)
vm.use(ElementPlus)
// app.mount('#app')

vm.config.globalProperties.$get = $get;

vm.config.globalProperties.$postf = $postf;
vm.config.globalProperties.$postj = $postj;
vm.config.globalProperties.$postx = $postx;
vm.config.globalProperties.$showErr = 
function( msg ){
	store.state.erropen = false;
	store.state.errmsg = msg;
};


vm.config.globalProperties.$axios = axios;
vm.config.globalProperties.$ip = "http://127.0.0.1:9000";

vm.mount('#app')


